interface ExclusionObjParams {
	obj: object
	excludeFields: string[]
}

export const exclusionObj = (obj: ExclusionObjParams["obj"], excludeFields: ExclusionObjParams["excludeFields"]) => {
	const clonedObj = { ...obj }

	excludeFields.forEach(field => delete clonedObj[field as keyof object])

	return clonedObj
}

export const removeIfEmptyString = (obj: object) => {
	const clonedObj: { [key: string]: any } = { ...obj }

	Object.keys(clonedObj).forEach(key => {
		if (clonedObj[key] === "") {
			delete clonedObj[key]
		}
	})

	return clonedObj
}
